import React from 'react'
import { StyleSheet, TouchableOpacity } from 'react-native'
import { variables } from '../styles'
import { Icon } from './icon'

export const IconButton = ({
  name,
  size = 32,
  color = variables.color_text_caption,
  onPress = () => {},
  ...props
}) => (
  <TouchableOpacity style={styles.container} onPress={onPress}>
    <Icon name={name} size={size} color={color} {...props} />
  </TouchableOpacity>
)

const styles = StyleSheet.create({
  container: {
    paddingHorizontal: variables.h_spacing_lg,
  },
})
